﻿#ifndef DAAPPRIBBONAREA_H
#define DAAPPRIBBONAREA_H
#include <QObject>
#include "DAAppRibbonAreaInterface.h"
class AppMainWindow;
namespace Ui {
class AppMainWindow;
}
class SARibbonBar;
class SARibbonCategory;
class SARibbonPannel;

/**
 * @brief App的Ribbon区域接口，负责ribbon层的管理和调度
 *
 * @todo 后续抽象出DAAppRibbonAreaInterface，DAAppRibbonArea继承DAAppRibbonAreaInterface，并把可暴露的方法暴露出来，实现插件化
 */
class DAAppRibbonArea : public DAAppRibbonAreaInterface
{
    friend class AppMainWindow;
    Q_OBJECT
public:
    DAAppRibbonArea(SARibbonMainWindow *w, DACoreInterface *c);

    //发生语言变更时会触发此函数
    virtual void retranslateUi() override;

    //获取app
    AppMainWindow *app() const;

    //获取ribbon
    SARibbonBar *ribbonBar() const;

private:
    //构建界面
    void buildRibbon();

    //构建主页
    void buildMainCategory();

    //构建主页
    void buildViewCategory();

private:
    AppMainWindow *m_app;
    Ui::AppMainWindow *ui;                  ///< 为了和AppMainWindow同步，也定义为ui
    SARibbonCategory *m_categoryMain;       ///< 主页标签
    SARibbonPannel *m_pannelMainFileOpt;    ///< 文件操作
    SARibbonCategory *m_categoryView;       ///< 视图标签
    SARibbonPannel *m_pannelViewMainView;   ///< 主要视图操作
};

#endif // DAAPPRIBBONAREA_H
